package ups.Common;

import java.io.OutputStream;
import java.io.PrintStream;

public class DebugPrintStream extends PrintStream {
	private boolean debug;
	PrintStream ps;
	public DebugPrintStream(OutputStream arg0, boolean debug) {
		super(arg0);
		ps = new PrintStream( arg0 );
		this.debug = debug;
	}

	public void println() {
		if( debug == true ) {
			ps.println();
		}
	}
	
	public void println(String s) {
		if( debug == true ) {
			ps.println( s );
		}
	}
	
	public void enablePrint() {
		debug = true;
	}
	public void disablePrint() {
		debug = false;
	}
	

}
